package com.example.demo.entity;

import com.example.demo.commons.base.BaseEntity;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

@Data
@Accessors(chain = true)
public class User extends BaseEntity {
    // 账号- 学号
    @NotBlank(message =  "用户名不能为空")
    @Length(min = 4,max = 20,message = "用户名的长度必须在{min}到{max}之间")
    private String username;
    // 密码
    @NotBlank(message = "密码必能为空")
    @Length(min = 6,max = 20,message = "密码的长度为必须在{min}到{max}之间")
    private String password;
    // 昵称
    @NotBlank(message = "不能为空")
    private String nickname;
    //邮箱地址
    @NotBlank(message = "不能为空")
    @Email(message = "地址不正确")
    private String email;
    //头像
    private String header;
    //昵称的拼英
    private String pinyin;
}
